﻿<UserControl x:Class="GeoFinderClientApp.View.UserControls.TimeOutSettingsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converters="clr-namespace:GeoFinderClientApp.Converters"
    xmlns:block="clr-namespace:GeoFinderClientApp.Utils.Blocking"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>
        <converters:TimeOutTypeConverter x:Key="TimeOutTypeConverter"/>
        <converters:BoolBrushConverter x:Key="BoolBrushConverter" />
        <converters:TimeOutDescriptionConverter x:Key="TimeOutDescriptionConverter" />
        <!--<vm:ViewModels x:Key="ViewModelsDataSource" d:IsDataSource="True"/>-->
        <Style x:Key="DescTextStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
            <Setter Property="FontSize" Value="18" />
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="Margin" Value="16,-38,16,24" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
        <ListBox x:Name="TimeOutOptions" ItemsSource="{Binding}" SelectionChanged="TimeOutOptions_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                            <toolkitPrimitives:ToggleSwitch Width="460" FontSize="22" HorizontalAlignment="Stretch" x:Name="toggleSwitch"
                                Header="{Binding Path=Type, Mode=OneWay, Converter={StaticResource TimeOutTypeConverter}}"
                                IsChecked="{Binding Path=AutomaticRefreshMode, Mode=TwoWay}" 
                                 />

                            <!--<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left"  Grid.Column="0" Text="{Binding Path=Type, Mode=OneWay, Converter={StaticResource TimeOutTypeConverter}}"/>
                            <TextBox VerticalAlignment="Top" Height="70" HorizontalAlignment="Center" Grid.Column="1" InputScope="Time" x:Name="timePicker" Text="{Binding Path=TimeOut, Mode=TwoWay}"/>-->
                            <!--<toolkitPrimitives:TimePicker VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="1" x:Name="TimePicker" Value="{Binding Path=TimeOut, Mode=TwoWay, Converter={StaticResource TimeSpanConverter}}" ValueStringFormat="{}{0:T}" ValueChanged="timePicker_ValueChanged"/>-->
                        
                            <TextBlock VerticalAlignment="Bottom" Style="{StaticResource DescTextStyle}"  Grid.Row="1" Text="{Binding Path=Type, Mode=OneWay, Converter={StaticResource TimeOutDescriptionConverter}}"/>

                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
